<?php
require_once( 'smarty/Smarty.class.php' );
    
class AdvancedSmarty extends Smarty
{
    public function __construct()
    {
        parent::__construct();
        
        $this->template_dir = TEMPLATES_DIR;
        $this->compile_dir  = TEMPLATES_COMPILE_DIR;
        $this->config_dir   = CONFIGS_DIR;
        $this->cache_dir    = CACHE_DIR;
    
        $this->caching = true;
        $this->assign( 'app_name', 'Advanced Smarty' );
    }

    public function buildLayout( $tplName, $vars = array() )
    {
        $this->assign( $vars );
        $this->display( $tplName );
    }

    public function getView( $tplName, $vars = array() )
    {
        $this->assign( $vars );
        return $this->fetch( $tplName );
    }
}
?>